package tests;

import static org.junit.Assert.assertEquals;
import model.components.ComponentLight;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import utils.Constants;

import controller.FakeNetwork;

public class ComponentLightTest {

	protected ComponentLight cl;

	@Before
	public void setUp() throws Exception {
		FakeNetwork fnet = new FakeNetwork();
		cl = new ComponentLight("Light 1", Constants.COMPONENT_LIGHT_GREEN);
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testState() {
		cl.setComponentState(Constants.COMPONENT_LIGHT_RED);
		assertEquals((boolean) true, cl.getComponentState() == Constants.COMPONENT_LIGHT_RED);
		cl.setComponentState(Constants.COMPONENT_LIGHT_GREEN);
		assertEquals((boolean) true, cl.getComponentState() == Constants.COMPONENT_LIGHT_GREEN);
		cl.setComponentState(Constants.COMPONENT_LIGHT_RED);
		assertEquals((boolean) true, cl.getComponentState() == Constants.COMPONENT_LIGHT_RED);
	}
}
